import { dirname } from 'path';
import process from 'process'
import fs, { mkdir, rmdir } from 'fs'
import path from 'path'
import jszip from 'jszip'
import { Asyncer, CopyDir, DirForeach, FindProjectRoot, GetBuildTarget, GetMD5Path, MkDir, Rename, RmDir, RmDirToJob, ZipDir } from './src/utils.mjs';
import { BuildConfig, BuildInfo } from './src/classes.mjs';
import { AsyncLocalStorage } from 'async_hooks';
const __dirname = dirname(process.argv[1]);

const rootPath = FindProjectRoot();
if (!rootPath) {
    console.log(`项目文件夹错误`);
    process.exit(1);
}
console.log(`项目文件夹${rootPath}`);

RmDir(path.resolve(rootPath, "build"));
MkDir(path.resolve(rootPath, "build"));
console.log("--- 清理完成");